/**
 * @author: yasen
 * @time: 2022/10/11 11:03
 * @email: yasen@yasenstudio.com
 */
package org.example;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class SimpleRecordDAOProxy implements ConsumerRecordDAO {
    private ConsumerRecordDAO consumerRecordDAO;

    public SimpleRecordDAOProxy() throws SQLException, IOException {
        Connection connection = new StudioMysqlConnection().getConnection();
        this.consumerRecordDAO = new ConsumerRecordDAOImpl(connection);
    }
    @Override
    public <K, V> void create(K key, V value) {
        try {
            consumerRecordDAO.create(key, value);
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
